//
//  OpshoppingCell.m
//  LoveBeeProject
//
//  Created by skywalker on 17/1/4.
//  Copyright © 2017年 斯芬克斯. All rights reserved.
//

#import "OpshoppingCell.h"
@interface OpshoppingCell()
@property (nonatomic, strong) UIButton *selectedBtn;
@property (nonatomic, strong) UIImageView *shoppingIcon;
@property (nonatomic, strong) UILabel *siftLabel;
@property (nonatomic, strong) UILabel *shoppingName;
@property (nonatomic, strong) UILabel *moneyLabel;

@end
@implementation OpshoppingCell
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        self.selectionStyle = UITableViewCellSelectionStyleNone;
        _selectedBtn = [[UIButton alloc]init];
        _selectedBtn.selected = YES;
        [_selectedBtn setImage:[UIImage imageNamed:@"v2_noselected"] forState:UIControlStateNormal];
        [_selectedBtn setImage:[UIImage imageNamed:@"v2_selected"] forState:UIControlStateSelected];
        [_selectedBtn addTarget:self action:@selector(shoppingSelectedClick:) forControlEvents:UIControlEventTouchUpInside];
        
        _shoppingIcon = [[UIImageView alloc]init];
        _siftLabel = [[UILabel alloc]init];
        _siftLabel = [[UILabel alloc]init];
        _siftLabel.font = [UIFont systemFontOfSize:11];
        _siftLabel.layer.borderWidth = 1;
        _siftLabel.layer.borderColor = [UIColor redColor].CGColor;
        _siftLabel.layer.cornerRadius = 3;
        _siftLabel.layer.masksToBounds = YES;
        _siftLabel.textAlignment = NSTextAlignmentCenter;
        _siftLabel.textColor = [UIColor redColor];
        _siftLabel.text = @"凑单专区";
        _siftLabel.hidden = YES;
        
        _shoppingName = [[UILabel alloc]init];
        _shoppingName.font = [UIFont systemFontOfSize:15];
        _shoppingName.textAlignment = NSTextAlignmentLeft;
        
        _moneyLabel = [[UILabel alloc]init];
        _moneyLabel.font = [UIFont systemFontOfSize:15];
        _moneyLabel.textAlignment = NSTextAlignmentLeft;
        _moneyLabel.textColor = [UIColor redColor];
     
        [_selectedBtn mas_makeConstraints:^(MASConstraintMaker *make) {
            make.height.width.mas_equalTo(15);
            make.leading.equalTo(self).offset(10);
            make.centerY.equalTo(self);
        }];
        [_shoppingIcon mas_makeConstraints:^(MASConstraintMaker *make) {
            make.height.width.mas_equalTo(50);
            make.leading.equalTo(_selectedBtn.mas_trailing).offset(5);
            make.centerY.equalTo(self);
        }];
        [_siftLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.width.mas_equalTo(25);
            make.height.mas_equalTo(15);
            make.top.equalTo(_shoppingIcon);
            make.leading.equalTo(_shoppingIcon.mas_trailing).offset(5);
        }];
        [_shoppingName mas_makeConstraints:^(MASConstraintMaker *make) {
            make.leading.equalTo(_siftLabel.mas_trailing);
            make.trailing.equalTo(self);
            make.height.mas_equalTo(15);
            make.top.equalTo(_shoppingIcon);
        }];
        [_moneyLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.leading.equalTo(_siftLabel);
            make.width.mas_equalTo(80);
            make.bottom.equalTo(_shoppingIcon.mas_bottom);
            make.height.mas_equalTo(15);
        }];
        
       
        
        
    }
    return self;
}
-(void)shoppingSelectedClick:(UIButton * )button{
    
}
- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
